package com.io.dao;

import java.util.Date;

import com.io.dto.StudentRes;

import com.io.entity.one2many.Student;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

/**
 * The class/interface
 *
 * @author guodd
 * @version 1.0 use jdk 1.8
 */
public interface TbStudentMapper {
    /* 01、基础的增删改查 */
    int insert(Student record);

    int insertSelective(Student record);

    int deleteByPrimaryKey(Integer sid);

    int updateByPrimaryKeySelective(Student record);

    int updateByPrimaryKey(Student record);

    Student selectByPrimaryKey(Integer sid);

    List<Integer> getAge();

    List<Student> findByAll(Student tbStudent);

    List<Student> findByCreateTimeBetween(@Param("minCreateTime") Date minCreateTime, @Param("maxCreateTime") Date maxCreateTime);


    List<StudentRes> getStudentNameAndAgeBySid(@Param("sid") Integer sid);

    List<Student> findByStudentNameAndAge(@Param("studentName") String studentName, @Param("age") Integer age);

    List<Student> findByStudentNameAndAgeBetween(@Param("studentName") String studentName, @Param("minAge") Integer minAge, @Param("maxAge") Integer maxAge);

    List<Student> findBySidAndStudentNameOrderBySidDesc(@Param("sid") Integer sid, @Param("studentName") String studentName);

    int updateAgeBySid(@Param("updatedAge") Integer updatedAge, @Param("sid") Integer sid);

    int updateAgeAndStudentNameBySid(@Param("updatedAge") Integer updatedAge, @Param("updatedStudentName") String updatedStudentName, @Param("sid") Integer sid);

    int deleteBySidAndAge(@Param("sid") Integer sid, @Param("age") Integer age);

    Integer countBySidIn(@Param("sidCollection") Collection<Integer> sidCollection);

    /* 02、四种传参方式 */

    /* 03、分页操作 */

    /* 04、查询模型 */

    /* 05、动态SQL */
}
